let mongoose = require('mongoose');

let schema = new mongoose.Schema({
});

schema.methods={
    async addEvent(options){
        // //计算出当前小时所处的时间戳
        // let now=new Date();
        // let nowMinute=now.getMinutes();
        // let nowSencond=now.getSeconds();
        // let nowMillisecond=now.getMilliseconds();
        // let nowTick=now.getTime()-nowMinute*60000-nowSencond*1000-nowMillisecond;
        // let CensusModel=mongoose.models['Census'];
        // let census=await CensusModel.findOne({group:'点击事件统计',type:options.key,timeTick:nowTick});
        // if(!census){
        //     census=await CensusModel.create({
        //         group:'点击事件统计',
        //         type:options.key,
        //         timeTick:nowTick
        //     });
        // }
        // census.count++;
        // await census.save();
    }
};

module.exports = schema;